package tq.com.tqcom.util;

import java.util.ArrayList;

public class TQSystemDefine {
    final static public int SUBJECT_yuwen = 10;
    final static public int SUBJECT_shuxue = 11;
    final static public int SUBJECT_yingyu = 12;
    final static public int SUBJECT_wuli = 13;
    final static public int SUBJECT_huaxue = 14;
    final static public int SUBJECT_shengwu = 15;
    final static public int SUBJECT_lishi = 16;
    final static public int SUBJECT_dili = 17;

    static public String subjectTitle(int subject){
        if(subject < SUBJECT_yuwen || subject > SUBJECT_dili){
            return "";
        }
        final String[] title = new String[]{
            "语文","数学", "英语", "物理",
                "化学", "生物", "历史", "地理"};
        int tmp = subject - SUBJECT_yuwen;

        return title[tmp];
    }


    //k可见范围
    final static public int SHOW_TYPE_ALL = 0x00;
    final static public int SHOW_MY_CLASS = 0x01;

    static public String showFanweiTitle(int t){
        if(t == SHOW_MY_CLASS){
            return "仅限我班";
        }
        return "全网可见";
    }
    //role
    final static public int Role_system_Admin = 100;
    final static public int Role_agent = 101;
    final static public int Role_teacher = 102;
    final static public int Role_student = 103;


    static public String gradeName(int g){
        String[] grad = new String[]{"一", "二", "三",
        "四", "五", "六", "七"};
        if(g > 0 && g < 8){
            int tmp = g - 1;
            //small
            return String.format("小学%s年级", grad[tmp]);
        }
        else if(g > 10 && g < 14){
            int tmp = g - 11;
            return String.format("初中%s年级", grad[tmp]);
        }else if(g > 20 && g < 24){
            int tmp = g - 21;
            return String.format("高中%s年级", grad[tmp]);
        }
        return "";
    }

    static public ArrayList<String> allGradeName(int level){
        ArrayList<String> grad = new ArrayList<>();
        if(level == 1){
            for (int i = 11; i < 14; i++){
                grad.add(gradeName(i));
            }
        }else if(level == 2){
            for (int i = 21; i < 24; i++){
                grad.add(gradeName(i));
            }
        }else{
            for (int i = 1; i < 8; i++){
                grad.add(gradeName(i));
            }
        }

        return grad;
    }

    final static public int FILE_TYPE_ALL = 0x00;
    final static public int FILE_TYPE_PDF = 0x01;
    final static public int FILE_TYPE_MP4 = 0x02;

    final static public int PUBLISH_STATE_SAVE = 0x00;
    final static public int PUBLISH_STATE_Publish = 0x01;


    final static public int LeaveMsgType_text = 0x00;
    final static public int LeaveMsgType_image = 0x01;
    final static public int LeaveMsgType_video = 0x02;

}
